#pragma once
#include "stdio.h"
#include "stdlib.h"

typedef int ElemType;

typedef struct Node {
    int data;
    struct Node* next;
} Node;

Node* init_list();

Node* create_node(ElemType data, Node* next);

void add_tail(Node* list, ElemType data);

void add_head(Node* list, ElemType data);

void add_pos(Node* list, ElemType data, int pos);

void del_tail(Node* list);

void del_head(Node* list);

void del_pos(Node* list, int pos);

ElemType get_val(Node* list, int pos);

ElemType get_head(Node* list);

ElemType get_tail(Node* list);

int get_len(Node* list);

int is_empty(Node* list);

void print_list(Node* list);

void clear_list(Node* list);
